package com.auxgroup.bridge.app.inner.vo;

import com.auxgroup.smarthome.utils.NewDateUtils;
import com.fasterxml.jackson.annotation.JsonGetter;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * @Author: laiqiuhua.
 * @Date: 2017/7/28 10:14.
 */
public class ShareUserListVo implements Serializable {
    @ApiModelProperty("分享id")
    private String id;
    @ApiModelProperty("用户id")
    private String uid;
    @ApiModelProperty("用户名称")
    private String username;
    @ApiModelProperty("设备id")
    private String deviceId;
    @ApiModelProperty("用户标签：0：主人，1：家人，2：好友")
    private Integer userTag;
    @ApiModelProperty("过期时间：精确到秒，10位数")
    private long expiredTime;

    public ShareUserListVo(){}

    public ShareUserListVo(String id, String uid, String username, String deviceId, Integer userTag, long expiredTime) {
        this.id = id;
        this.uid = uid;
        this.username = username;
        this.deviceId = deviceId;
        this.userTag = userTag;
        this.expiredTime = expiredTime;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getUserTag() {
        return userTag;
    }

    public void setUserTag(Integer userTag) {
        this.userTag = userTag;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public long getExpiredTime() {
        return expiredTime;
    }

    public void setExpiredTime(long expiredTime) {
        this.expiredTime = expiredTime;
    }

    /**
     * 返回服务器当前时间戳，防止app更改系统时间
     * @return
     */
    @ApiModelProperty("服务器当前时间戳，10位精确到秒")
    @JsonGetter
    public Long getCurrentTimestamp() {
        return NewDateUtils.getCurrentInstant().getEpochSecond();
    }

}
